package router

import (
	"3-19yk/client/client"
	"3-19yk/client/enit"
	"3-19yk/client/response"
	"3-19yk/common/proto/user"
	"github.com/gin-gonic/gin"
)

func EsSync(c *gin.Context) {
	sync, err := client.EsSync(c, &user.EsSyncReq{})
	if err != nil {
		response.ResPonseError(c, err.Error())
		return
	}
	response.ResPonseSuccess(c, sync)
}
func EsSear(c *gin.Context) {
	var data enit.EsSear
	err := c.ShouldBind(&data)
	if err != nil {
		response.ResPonseError(c, err.Error())
		return
	}
	sync, err := client.EsSear(c, &user.EsSearReq{
		FormName: data.FormName,
	})
	if err != nil {
		response.ResPonseError(c, err.Error())
		return
	}
	response.ResPonseSuccess(c, sync)
}
func ScenicShow(c *gin.Context) {
	var data enit.ScenicShow
	err := c.ShouldBind(&data)
	if err != nil {
		response.ResPonseError(c, err.Error())
		return
	}
	sync, err := client.ScenicShow(c, &user.ScenicShowReq{
		Id: int64(data.Id),
	})
	if err != nil {
		response.ResPonseError(c, err.Error())
		return
	}
	response.ResPonseSuccess(c, sync)
}
